﻿using BGYXControlLibrary;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MyWpfControls.Pages
{
    /// <summary>
    /// Icons.xaml 的交互逻辑
    /// </summary>
    public partial class Icons : Page
    {
        public Icons()
        {
            InitializeComponent();
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            foreach (var icon in Enum.GetValues(typeof(BGYXControlLibrary.Enums.Icons)))
            {
                BGYX_Icon _icon = new BGYX_Icon()
                {
                    Icon = (BGYXControlLibrary.Enums.Icons)icon,
                    Width = 50,
                    Height = 50,
                    Margin = new Thickness(3),
                    ToolTip = icon.ToString()
                };
                _icon.MouseEnter += _icon_MouseEnter;
                _icon.MouseLeave += _icon_MouseLeave; ;
                panel.Children.Add(_icon);
            }
        }

        private void _icon_MouseLeave(object sender, MouseEventArgs e)
        {
            var icon = sender as BGYX_Icon;
            icon.Color = Brushes.Black;
        }

        private void _icon_MouseEnter(object sender, MouseEventArgs e)
        {
            var icon = sender as BGYX_Icon;
            icon.Color = Brushes.LightCoral;
        }
    }
}
